package com.group.yztcedu.playlive.main.home;

import com.group.yztcedu.playlive.bean.HomeBean;
import com.group.yztcedu.playlive.utils.HttpUtils;

import java.util.HashMap;

public class HomePresenter implements HomeContract.Presenter {
    private HomeContract.View view;
    private HomeContract.Model model;
    public HomePresenter(HomeContract.View view,HomeContract.Model model){
        this.view = view;
        this.model = model;
    }
    @Override
    public void initData(HashMap<String, String> params) {
        model.getHomeData(params, new HttpUtils.HttpCallBack<HomeBean>() {
            @Override
            public void onSuccess(HomeBean homeBean) {
                view.onSuccessGetHomeData(homeBean.getData());
            }
            @Override
            public void onFail() {
                view.onFailGetHomeData("网络连接错误");
            }
        });
    }
}
